home *** CD-ROM | disk | FTP | other *** search
- --- 1.1 1994/03/25 18:27:46
- +++ lib/system.h 1994/03/25 18:29:02
- @@ -129,7 +129,7 @@
- #endif
- #undef HAVE_MAJOR
-
- -#ifdef _POSIX_VERSION
- +#if defined(_POSIX_VERSION) || defined(atarist)
- #include <utime.h>
- #else /* not _POSIX_VERSION */
- struct utimbuf
- --- 1.1 1994/03/26 10:10:10
- +++ lib/mountlist.c 1994/03/26 18:16:12
- @@ -99,6 +99,15 @@
- #define MOUNTED_GETMNTTBL
- #endif
-
- +#ifdef atarist
- +#include <dirent.h>
- +#include <stat.h>
- +#include <sys/statfs.h>
- +#include <osbind.h>
- +#include <mintbind.h>
- +extern int __mint;
- +#endif
- +
- #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
- /* Return the value of the hexadecimal number represented by CP.
- No prefix (like '0x') or suffix (like 'h') is expected to be
- @@ -199,6 +208,118 @@
- me->me_next = NULL;
- mount_list = mtail = me;
-
- +/* The following routine was taken from an earlier port */
- +/* of the fsutils (3.3) by somebody else (? ERS ?). */
- +/* It was adapted by HPP to show all filesystems on U: */
- +#ifdef __MINT__ /* MiNT on Atari ST */
- + {
- + static char ubuf[128] = "u:/";
- + char _ubuf[128];
- + DIR *udrv;
- + struct dirent *next;
- + struct stat statbuf;
- + long drvmap, ssp;
- + int i;
- + int r;
- + int offset;
- + struct mount_entry *him;
- + struct statfs stbuf;
- +
- + struct {
- + long ninodes, nzones;
- + long finodes, fzones;
- + short version;
- + short increment;
- + long res1, res2, res3, res4;
- + } mfsinfo;
- +
- + offset = (Dgetdrv() == 'U'-'A') ? 2 : 0;
- + ssp = Super(0L);
- + drvmap = *((long *)0x4c2); /* get which drives are attached */
- + if ((*(short *)0x4a6) != 2)
- + drvmap &= ~2; /* drive B: isn't really there */
- + Super(ssp);
- +
- + for (i = 0; i < 32; i++)
- + {
- + if (drvmap & (1L << i))
- + {
- + /* drive 'a' + i ist there. */
- + me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
- + me->me_devname = xstrdup("a:");
- + me->me_devname[0] = 'a'+i;
- + me->me_mountdir = xstrdup(ubuf);
- + me->me_mountdir[0] = me->me_devname[0];
- + me->me_dev = i;
- + me->me_next = NULL;
- +
- + /* It's possible to Dcntl on minixfs */
- + _unx2dos (me->me_mountdir, _ubuf);
- + if(Dcntl(0x104, _ubuf, (long) &mfsinfo)==0)
- + me->me_type = xstrdup( "minix" );
- + else
- + me->me_type = xstrdup( (i < 16) ? "tos" : "pseudo" );
- +
- + mtail->me_next = me;
- + mtail = me;
- + }
- + }
- + udrv = opendir(ubuf);
- + if (udrv)
- + {
- + while (next = readdir(udrv))
- + {
- + strcpy(ubuf+3, next->d_name);
- + lstat(ubuf, &statbuf);
- +
- + if ( (statbuf.st_mode & S_IFMT) == S_IFDIR )
- + {
- + int replaced = 0;
- +
- + for (him = mount_list->me_next; him; him = him->me_next)
- + {
- + if (him->me_devname[0] - 'a' == statbuf.st_dev)
- + {
- + replaced = 1;
- + free(him->me_mountdir);
- + him->me_mountdir = xstrdup(ubuf+offset);
- + }
- + }
- +
- + /* Show all subdirs of U: that are not physical drives */
- + /* as U:-mounted filesystems. This shows U:\PROC etc. */
- + /* Only do this if MiNT 0.99 or higher is running. */
- + /* (Since Dfree() changed in MiNT 0.97). */
- + if (!replaced && (__mint >= 99) &&
- + (statbuf.st_dev >= 32)) /* Pseudodrive */
- + {
- + char *ptr;
- +
- + me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
- + /* mountdir is /xxx (/proc, for instance */
- + me->me_mountdir = xstrdup(ubuf+offset);
- + /* devname is filesys-name (procfs, for instance). */
- + /* this is constructed by catting 'fs' after the dirname */
- + ptr = ubuf+offset;
- + while (*ptr != 0x00)
- + ptr += 1;
- + *ptr++ = 'f';
- + *ptr++ = 's';
- + *ptr++ = ':';
- + *ptr = 0x00;
- + me->me_devname = xstrdup(ubuf+offset+1);
- + me->me_dev = statbuf.st_dev;
- + me->me_next = NULL;
- + me->me_type = xstrdup( "pseudo" );
- + mtail->me_next = me;
- + mtail = me;
- + }
- + } /* End of if (directory in U:) */
- + } /* End of while (not end of U:) */
- + }
- + }
- +#endif /* __MINT__ */
- +
- #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
- {
- struct mntent *mnt;
-